﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Actya.Core.SiteStructure;

namespace Actya.Core.Content
{
	public abstract class ContentBase : IContent
	{
		/// <summary>
		/// Gets a textual representation of the content. 
		/// </summary>
		public abstract string ContentAsText { get; }

		/// <summary>
		/// Initialize content for the given theme.
		/// </summary>
		/// <param name="theme"></param>
		/// <returns></returns>
		public virtual IContent InitializeForTheme(Theme theme)
		{
			// Nothing special
			return this;
		}

		/// <summary>
		/// Sanitize content with the given sanitzer.
		/// </summary>
		/// <param name="sanitize"></param>
		/// <returns>The sanitized context.</returns>
		public abstract IContent SanitizeContent(Func<string, string> sanitize);

		/// <summary>
		/// Returns the string representation of the content object.
		/// </summary>
		/// <returns></returns>
		public override string ToString()
		{
			return ContentAsText;
		}

	}
}
